home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / pump_src / text1.c < prev    next >
C/C++ Source or Header  |  1995-10-26  |  2KB  |  76 lines

  1.  
  2. #include "pump.h"
  3.  
  4. FONT_TFont F1;
  5.  
  6. PUBLIC void F1Init(void) {
  7.     FONT_Load(&F1, "tnrfont1.fnt");
  8. }
  9.  
  10.  
  11. PUBLIC void F1Do1(void) {
  12.     int i, w;
  13.     static char t[] = "PARTY CODING";
  14.     static char t2[] = "RULES";
  15.  
  16.     memset(GL_Pal, 0, 768);
  17.     GL_Pal[15*3+0] = 63;
  18.     GL_Pal[15*3+1] = 63;
  19.     GL_Pal[15*3+2] = 63;
  20.  
  21.     TEXT_GetExtent(&F1, 0, 0, t, &w, 0);
  22.  
  23.     VBL_DumpPalette(GL_Pal, 0, 256);
  24.     i = 0;
  25.     VBL_VSync(0);
  26.     while (!LLK_SpacePressed) {
  27.         if (i > strlen(t))
  28.             break;
  29.         memset(LLS_Screen[0], 0, LLS_Size);
  30.  
  31.         TEXT_Printf(&F1, (320-w)/2, 50, 15, "%.*s", i, t);
  32.  
  33.         LLS_Update();
  34.         {
  35.             byte buf[768];
  36.             int i;
  37.             for (i = 0; i < 256; i++) {
  38.                 buf[i*3+0] = 32+rand()%31;
  39.                 buf[i*3+1] = 32+rand()%31;
  40.                 buf[i*3+2] = 32+rand()%31;
  41.             }
  42.             VBL_DumpPalette(buf, 0, 256);
  43.             VBL_DestPal = GL_Pal;
  44.             VBL_DestRed = VBL_DestGreen = VBL_DestBlue = 0;
  45.             VBL_FadeMode =  VBL_FADEFAST;
  46.             VBL_FadeStartColor = 0;
  47.             VBL_FadeNColors = 256;
  48.             VBL_FadePos = 1;
  49.             VBL_FadeSpeed = 8;
  50.         }
  51.         VBL_VSync(20);
  52.         i++;
  53.     }
  54.     TEXT_GetExtent(&F1, 0, 0, t2, &w, 0);
  55.  
  56.         {
  57.             byte buf[768];
  58.             int i;
  59.             for (i = 0; i < 256; i++) {
  60.                 buf[i*3+0] = 63;
  61.                 buf[i*3+1] = 63;
  62.                 buf[i*3+2] = 63;
  63.             }
  64.             VBL_DumpPalette(buf, 0, 256);
  65.             VBL_DestPal = GL_Pal;
  66.             VBL_DestRed = VBL_DestGreen = VBL_DestBlue = 0;
  67.             VBL_FadeMode =  VBL_FADEFAST;
  68.             VBL_FadeStartColor = 0;
  69.             VBL_FadeNColors = 256;
  70.             VBL_FadePos = 1;
  71.             VBL_FadeSpeed = 1;
  72.         }
  73.         TEXT_Printf(&F1, (320-w)/2, 130, 15, t2);
  74.         LLS_Update();
  75. }
  76.